Added new console commands to import or export formie form to a target folder #1972
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi
I wrote this first as a module for our project to facilitate automatic form imports post-deployment.
The current workflow involves exporting complex forms as JSON to a project folder, which allows us to track changes effectively.
Any team developer can import a form, modify it, and export it back to the project folder.
These changes can then be committed, eliminating the need to modify forms directly on the live server.
I took the time to make a pull request to share these commands, so others can also benefit.
The following console commands have been added:
By default, all exports will be placed in the folder
@storage/formie-export
, but via the settings, this can be changed to any other folder:How to use the commands:
Export
Import
Import all
./craft formie/forms/import-all # You can also change the target folder ./craft formie/forms/import-all exports/formie
Please feel free to share your feedback. I am happy to make any necessary changes.